<template>
  <div class="app-container">
    <el-tabs :tab-position="tabPosition" style="height: 900px">
      <el-tab-pane label="个人信息">
        <div class="selfInfo">
          <!-- <div class="head"><span>个人信息</span></div> -->
          <div class="partition ownerNickname">
            <span>昵称</span>
            <el-input v-model="nickName"></el-input>
          </div>
          <div class="partition desc">
            <span>简介</span>
            <el-input v-model="userInfo.desc"></el-input>
          </div>
          <div class="partition phone">
            <span>电话</span>
            <el-input v-model="userInfo.phone"></el-input>
          </div>
          <div class="partition sex">
            <span>性别</span>
            <el-input v-model="userInfo.sex"></el-input>
          </div>
          <div class="headPic">
            <span>你的头像</span>
            <img
              src="https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"
            />
            <span>新头像</span>
            <el-upload
              class="avatar-uploader"
              action="https://jsonplaceholder.typicode.com/posts/"
              :show-file-list="false"
              :on-success="handleAvatarSuccess"
              :before-upload="beforeAvatarUpload"
            >
              <img v-if="imageUrl" :src="imageUrl" class="avatar" />
              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            </el-upload>
          </div>
          <div class="btn">
              <el-button type="primary" @click="updateInfo">更新信息</el-button>
          </div>
        </div>
      </el-tab-pane>
      <el-tab-pane label="账号信息">
          <div class="accountInfo">
              <!-- <div class="head"><span>账号信息</span></div> -->
              <div class="account">
                  <span>账号</span>
                  <el-input v-model="token" :disabled="true"></el-input>
              </div>
              <div class="pwd">
                  
              </div>
          </div>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  data() {
    return {
      imageUrl: "",
      userInfo: [],
      tabPosition: 'left'
    }
  },
computed: {
    ...mapGetters([
      'nickName',
      'token'
    ])
  },
methods: {
      updateInfo(event){

      }
  }
}
</script>

<style lang="scss" scoped>
.app-container{
    margin: 0 auto;
    width: 100%;
    height: 100%;
}
.selfInfo{
    width: 100%;
    height: 100%;
}
.head{
    width: 70%;
    height: 24px;
    line-height:24px;
    margin-bottom: 10;
    font-weight: 900;
    // border: lightsteelblue 1px solid;
    // border-radius: 5px;
}
.partition{
    width: 70%;
    height: 120px;
}

.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
.avatar {
  width: 178px;
  height: 178px;
  display: block;
}
</style>